const express = require("express");
const router = express.Router();
const expressJoi = require("@escook/express-joi")


const userinfo_handler = require("../router_handler/userinfo")

const {update_userinfo_schema,update_avatar_schema,update_pwd_schema} = require("../schema/user")


//获取用户信息
router.get("/userinfo",userinfo_handler.getUserInfo)
// 更新用户的基本信息
router.post("/updateuserinfo",expressJoi(update_userinfo_schema),userinfo_handler.updateUserInfo)
//更改密码
router.post("/updatepwd",expressJoi(update_pwd_schema),userinfo_handler.updatePwd)
//更新头像
router.post("/updateavatar",expressJoi(update_avatar_schema),userinfo_handler.updateAvatar)

module.exports = router;
